package com.atguigu.a_properties;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Properties;

public class Demo1 {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();

        //必须键和值的元素类型是String
        properties.setProperty("Version","1.0");
        properties.setProperty("Author","Damon");
        properties.setProperty("Date","2023-10-20");

        //一键存集合内容到文件
        //.properties 属性集文件
        FileWriter fw = new FileWriter("T_Day24\\test\\info.properties");

        properties.store(fw,"I am comments !!");

        fw.close();

    }
}
